<?php
/**
 * Created by PhpStorm.
 * User: chenzhi
 * Date: 16/8/18
 * Time: 下午8:28
 */

defined('BASEPATH') OR exit('No direct script access allowed');

class Dcommentupm extends CI_Model
{
    function __construct()
    {
    }

    //插入点赞
    public  function insert_commentup($sets)
    {
        $this->db->insert("ml_disubject_commentup",$sets);
        return $this->db->insert_id();
    }

    //获取点赞数
    public function get_commentup_count($query)
    {
        return $result = $this->db->where($query)->count_all_results("ml_disubject_commentup");
        //return $result = $this->cimongo->count_all("commentup");
    }

    //获取点赞列表
    public function get_comment_id($query,$limit,$offset)
    {
        //
        return $did_array = $this->db->where($query)->order_by("addtime", "desc")->get("ml_disubject_commentup",$limit, $offset)->result_array();

    }

}
